
//获取版本号
const getVersion = () => {
	var myDate = new Date();
	return `5.0.${myDate.getMonth()+1}${myDate.getDate()}${myDate.getHours()}${myDate.getMinutes()+1}` //版本号
}
module.exports = {
	publicPath: './',
	transpileDependencies: true,
	productionSourceMap: false,
	devServer: {
		allowedHosts: 'all',
		port: 8888,
		// proxy: {
		// 	'/console-mock': {
		// 		target: `https://console-mock.apipost.cn/mock/d4900bd1-def4-4f0e-80a0-1ee03bc5c36b`,
		// 		changeOrigin: true,
		// 		ws: true,
		// 		pathRewrite: {
		// 			"^/console-mock": ""
		// 		}
		// 	}
		// }
	},
	chainWebpack(config) {
		// 版本号在页面显示
		config.plugin('define').tap(args => {
			args[0]['process.env'].version = JSON.stringify(getVersion());
			return args;
		});
	},
	css: {
		loaderOptions: {
			less: {
				additionalData: `@import "~@/assets/less/var.less";`,
			},
		}
	}

}